#include <iostream>
#include <cmath>
using namespace std;

int Add(int num)
{
    int sum = 0;
    for (int i = 1; i < num; i++)
    {
        if (num % i == 0)
            sum += i;
    }
    return sum;
}
int main() {
    int n, count = 0;
    cin >> n;
    for (int i = 1; i <= n; i++)
    {
        if (i == Add(i))
            count++;
    }
    cout << count << endl;
    return 0;
}